// 管理用户数据相关
import { ref } from 'vue'
import { defineStore } from 'pinia'
import { loginAPI } from '@/api/user'

export const useUserStore = defineStore('user', () => {
  const userInfo = ref({})
  const getUserInfo = async({ account, password }) => {
    const res = await loginAPI({ account,password})
    userInfo.value = res.result
  }
  const clearUserInfo = () => {
    userInfo.value = {}

  }
  return {
    userInfo,
    getUserInfo,
    clearUserInfo
  }
})
